package LeetCode;

// 一个简单的计算器类
public class Calculator {
    private int result;

    public Calculator() {
        this.result = 0;
    }
    // 加
    public int add(int a, int b) {
        result = a + b;
        return result;
    }
    // 乘
    public int multiply(int a, int b) {
        result = a * b;
        return result;
    }

    public int getResult() {
        return result;
    }

    public static void main(String[] args) {
        Calculator calculator = new Calculator();
        int sum = calculator.add(5, 3);
        int product = calculator.multiply(4, 2);

        System.out.println("Sum: " + sum);
        System.out.println("Product: " + product);
        System.out.println("Final Result: " + calculator.getResult());
    }
}

